<!DOCTYPE html>

<html>

<head>
    <title></title>
    <script src='../vue.js'></script>
</head>

<body>
    <ul id="app-6">
        <div>
            <my-component v-for="(item, index) in items" :item="item" :index="index" :key="item.id"></my-component>
        </div>
    </ul>
    <script>
        Vue.component('my-component', {
            template: '\
                <li>\
                    {{ index }}:{{ item.msg }}\
                </li>\
            ',
            props: ['item', 'index']
        })
        var app6 = new Vue({
            el: '#app-6',
            data: {
                items: [
                    {
                        id: 1,
                        msg: 'item1'
                    },
                    {
                        id: 2,
                        msg: 'item2'
                    },
                    {
                        id: 3,
                        msg: 'item3'
                    }
                ]
            }
        })
    </script>
</body>


</html>